package com.slmn.visitor.gui;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javafx.geometry.Bounds;
import javafx.scene.Node;

public abstract class Component {
	static final Logger logger = LoggerFactory.getLogger(Component.class);
	private Component parent;
	protected static final double SPACE = 5;

	abstract public Node getNode();

	protected Component getParent() {
		return parent;
	}

	protected final void setParent(Component parent) {
		this.parent = parent;
	}

	public static interface HChild {
		public abstract HComposite getHParent();
		public abstract Bounds getCBounds();
		public abstract void addCursor(); 
		public abstract void setCNodesBG(CNodeState state);
	}
	
	protected enum CNodeState {
		FOCUSED, SELECTED, CLEAR;
		protected static final String focused = "-fx-background-color: white;";
		protected static final String selected = "-fx-background-color: yellowgreen;"; 
	
		public String getStyle(){
			switch (this) {
			case FOCUSED:
				return focused;
			case SELECTED:
				return selected;
			case CLEAR:
			default:
				return null;
			
			}
		}
	}
}
